package my.bean;

import java.io.Serializable;

public class Email implements Serializable {
	private static final long serivalVersionUID = 1L;
	// email地址
	private String mailAdd;
	// 是否是一个标准的email地址
	private boolean email;

	public Email() {

	}

	public Email(String mailAdd) {
		this.mailAdd = mailAdd;
	}

	public boolean isEmail() {
		String regex = "\\w+([-+.']\\w+)*@\\w+([-.]\\w)*\\.\\w+([-.]\\w+)*";
		if (mailAdd.matches(regex)) {
			email = true;
		} else {
			email = false;
		}
		return email;
	}

	public String getMailAdd() {
		return this.mailAdd;
	}

	public void setMailAdd(String mailAdd) {
		this.mailAdd = mailAdd;
	}
}
